<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<svg width="500" height="500" xmlns="http://www.w3.org/2000/svg">
    <line x1="0" y1="300" x2="50" y2="0" />
</svg>

<style>
    svg {
        background: #ccc;
    }


    @keyframes depict {
        from {
            stroke: red;
            stroke-dashoffset: 300;
        }
        to {
            stroke: red;
            stroke-dashoffset: 0;
        }
    }

    svg line{
        fill: none;
        stroke-width: 4;
        stroke: #999;
        stroke-dasharray: 300;
        animation: depict 2s linear 0s 1 normal forwards;
    }
</style>
</body>
</html>